package com.gds.wiki.cloud.orderCenter.server.modular.order.controller;

import com.gds.wiki.cloud.framework.common.dto.ResponseDto;
import com.gds.wiki.cloud.framework.common.exception.BizExceptionEnum;
import com.gds.wiki.cloud.framework.common.utils.ResponseDtoFactory;
import com.gds.wiki.cloud.framework.web.common.BaseController;
import com.gds.wiki.cloud.memberCenter.client.member.api.MemberApi;
import com.gds.wiki.cloud.memberCenter.client.member.model.Member;
import com.gds.wiki.cloud.memberCenter.client.member.model.query.MemberQuery;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "OrderController", tags = "订单中心微服务-订单管理")
@RequestMapping("/order")
@RestController
@Validated
public class OrderController  extends BaseController {


    @Autowired
    MemberApi memberApi;


    @PostMapping("/placeOrder")

    @ApiOperation(value = "下单",notes = "下单",httpMethod = "POST")
    @ApiImplicitParam(name = "Authorization", value = "请输入凭证", required = true, dataType = "String", paramType = "header")
    public ResponseDto placeOrder(){
        ResponseDto<Member> responseDto= ResponseDtoFactory.GetInstance().build(BizExceptionEnum.SUCCESSFUL_OPERATION);
        MemberQuery memberQuery=new MemberQuery();
        memberQuery.setLoginName("test111");
        Member  member=memberApi.getMember(memberQuery).responseData(Member.class);
        responseDto.setData(member);
        return responseDto;

    }

}
